package com.andrew.service;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.andrew.entity.Book;
import com.andrew.entity.Comment;

public interface CommentService {
	/***
	 * 写评论
	 * @param req
	 * @param resp
	 * @throws SQLException
	 * @throws IOException
	 */
	public abstract void writeComment(HttpServletRequest req,HttpServletResponse resp)throws SQLException,IOException;
	
	/**
	 * 删除评论
	 * @param req
	 * @param resp
	 * @throws SQLException
	 * @throws IOException
	 */
	public abstract void deleteComment(HttpServletRequest req,HttpServletResponse resp)throws SQLException,IOException;
	
	/**
	 * 获取某本书的所有评论
	 * @param req
	 * @param resp
	 * @param bookId
	 * @throws SQLException
	 * @throws IOException
	 */
	public abstract List<Comment> getCommentByBookId(int bookId)throws SQLException;
	
	public abstract List<Comment> getAllComments()throws SQLException;
}
